// 导入路由
import { BrowserRouter as Router, Route, Redirect } from 'react-router-dom'

// 导入页面组件
import Login from '@/pages/Login'
import Layout from '@/pages/Layout'

// 配置路由规则
function App() {
  return (
    <Router>
      <div className='app'>
        {/* 重定向 */}
        <Route exact path='/' render={() => <Redirect to='/home' />} />
        {/* 首页 */}
        <Route path='/home'>
          <Layout />
        </Route>
        {/* 登录页 */}
        <Route path='/login'>
          <Login />
        </Route>
      </div>
    </Router>
  )
}

export default App
